const initialState = {
    count:0
}


export function countReducer(state=initialState,action){
    // console.log(state)
    switch (action.type){
        case "plus" :
            state.count++
            // console.log(state.count)
            return {
                count:state.count
            }
        case "minus":
            if(state.count !== 0){
                state.count--
            }
            return {
                count:state.count
            }
        default:
            return state;
    }
}